package com.yamaha.bikedesalon.postItem;

import org.json.JSONObject;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.yamaha.bikedesalon.R;

public class HeaderItem implements Item {

	private static class HeaderHolder {
		TextView title;
		TextView dateView;
	}

	private final String title;
	private final String dateTime;

	public HeaderItem(final String title, final String dateTime) {
		this.title = title;
		this.dateTime = dateTime;
	}

	@Override
	public JSONObject getObject() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int getViewType() {
		return ViewType.HEADER.ordinal();
	}

	@Override
	public View getView(LayoutInflater inflater, View convertView, int position) {
		HeaderHolder holder = null;
		if (convertView == null) {
			convertView = inflater.inflate(R.layout.header_post_item, null);
			holder = new HeaderHolder();

			holder.title = (TextView) convertView.findViewById(R.id.post_part_title);
			holder.dateView = (TextView) convertView.findViewById(R.id.post_part_brand);

			convertView.setTag(holder);
		} else {
			holder = (HeaderHolder) convertView.getTag();
		}

		holder.title.setText(title);
		holder.dateView.setText(dateTime);

		return convertView;
	}

}
